import { fromJS } from 'immutable';
import { GET_DATA } from './actionTypes';

const defaultState = fromJS({
    title: '',
    imgUrl: '',
    content: ''
})

export default (state = defaultState, action) => {
    switch (action.type) {
        case GET_DATA:
            return state.merge({
                title:action.data.title,
                imgUrl:action.data.imgUrl,
                content:action.data.content,
            })
        default:
            return state;
    }
}